﻿<paging:MtPage x:Name="PageRoot"
               x:Class="SampleWindowsStoreApp.Views.MtPivotPage"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
               xmlns:paging="using:MyToolkit.Paging"
               xmlns:viewModels="using:SampleWindowsStoreApp.ViewModels"
               xmlns:controls="using:MyToolkit.Controls"
               mc:Ignorable="d">

    <paging:MtPage.Resources>
        <viewModels:DataGridPageModel x:Key="ViewModel" />
    </paging:MtPage.Resources>
    
    <Grid DataContext="{StaticResource ViewModel}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Button Margin="39,59,39,0" Command="{Binding Frame.GoBackCommand, ElementName=PageRoot}"
                    Style="{StaticResource NavigationBackButtonNormalStyle}" VerticalAlignment="Top"
                    AutomationProperties.Name="Back" AutomationProperties.AutomationId="BackButton" 
                    AutomationProperties.ItemType="Navigation Button"/>

            <TextBlock Style="{StaticResource SubheaderTextStyle}" Text="Windows 8 and MyToolkit Sample App" Margin="0,50,0,10" Grid.Column="1" />
        </Grid>

        <Grid Grid.Row="1" Margin="120,0,40,40">
            <controls:MtPivot SelectedIndex="1" x:Name="Pivot">
                <controls:MtPivotItem Header="Pivot 1">
                    <TextBlock Text="Pivot 1 Content" Style="{StaticResource BasicTextStyle}" />
                </controls:MtPivotItem>
                <controls:MtPivotItem Header="Pivot 2">
                    <controls:MtPivot SelectedBrush="Blue" UnselectedBrush="Chartreuse">
                        <controls:MtPivot.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Header}" FontSize="36" FontWeight="Light" Margin="0,-10,20,20"
                                           d:DataContext="{d:DesignInstance controls:MtPivotItem}" />
                            </DataTemplate>
                        </controls:MtPivot.HeaderTemplate>

                        <controls:MtPivotItem Header="Pivot 1">
                            <TextBlock Text="Pivot 1 Content" Style="{StaticResource BasicTextStyle}" />
                        </controls:MtPivotItem>
                        <controls:MtPivotItem Header="Pivot 2">
                            <TextBlock Text="Pivot 2 Content" Style="{StaticResource BasicTextStyle}" />
                        </controls:MtPivotItem>
                        <controls:MtPivotItem Header="Pivot 3">
                            <TextBlock Text="Pivot 3 Content" Style="{StaticResource BasicTextStyle}" />
                        </controls:MtPivotItem>
                    </controls:MtPivot>
                </controls:MtPivotItem>
                <controls:MtPivotItem Header="Pivot 3">
                    <TextBlock Text="Pivot 3 Content" Style="{StaticResource BasicTextStyle}" />
                </controls:MtPivotItem>
            </controls:MtPivot>
        </Grid>
        <StackPanel Grid.Row="2" Margin="120,0,0,20">
            <Button Content="Remove last pivot item" Click="OnRemoveLastPivotItem" />
        </StackPanel>
    </Grid>
</paging:MtPage>
